﻿<%@ WebHandler Language="C#" Class="Admin_Password_Edit" %>

using System;
using System.Web;

public class Admin_Password_Edit : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        string status = "-10";
        try
        {
            if (Admins.IsLogin(true))
            {
                string Admin_Password = context.Request.Params["Admin_Password"].ToString().Trim();
                string Admin_New_Password = context.Request.Params["Admin_New_Password"].ToString().Trim();
                if (Admin_New_Password.Length > 9)
                {
                    Admins admin = new Admins();
                    status = admin.ChangeAdminPassword(Admin_Password, Admin_New_Password).ToString();
                }
                else
                    status = "0";
            }
            else
                status = "0";
        }
        catch(Exception ex)
        {
            status = ex.ToString();
        }
        context.Response.Write(status);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}